import com.google.appengine.api.datastore.Entity

println """
<html>
	<head>
		<title>Init App</title>
	</head>
	<body>
	<pre>
"""
println '------------------------------------------------------------------------------'
println 'Init App'
println '------------------------------------------------------------------------------'
Date now = new Date()

def entities = datastore.execute{
	from AppConfigE
	where id == lastTranscationShowingLimit
	limit 1
}

Entity appconfig = null
if(entities.size() == 0 ) {
	appconfig = new Entity('AppConfigE')
	appconfig.id = 'lastTranscationShowingLimit'
	appconfig.value = 10
	appconfig.createdTime = now
	appconfig.updatedTime = now
	appconfig.save()
}
else {
	appconfig = entities[0]
}
println 'AppConfig - ' + appconfig.id

Entity user = null
entities = datastore.execute{
	from UserE
	where id == vteial
	limit 1
}
if(entities.size() == 0 ) {
	user = new Entity('UserE')
	user.id = 'vteial'
	user.password = 'wyd123'
	user.name = 'Eialarasu'
	user.emailId = 'vteial@wybis.com'
	user.timeZone = 'Chennai'
	user.createdTime = now
	user.updatedTime = now
	user.save()
}
else {
	user = entities[0]
}
println 'User - ' + user.id

entities = datastore.execute{
	from UserE
	where id == hari
	limit 1
}
if(entities.size() == 0 ) {
	user = new Entity('UserE')
	user.id = 'hari'
	user.password = 'wyd123'
	user.name = 'Hariharasubramanian'
	user.emailId = 'hari@wybis.com'
	user.timeZone = 'Chennai'
	user.createdTime = now
	user.updatedTime = now
	user.save()
}
else {
	user = entities[0]
}
println 'User - ' + user.id

entities = datastore.execute{
	from UserE
	where id == shishir
	limit 1
}
if(entities.size() == 0 ) {
	user = new Entity('UserE')
	user.id = 'shishir'
	user.password = 'wyd123'
	user.name = 'Shishir'
	user.emailId = 'shishir@wybis.com'
	user.timeZone = 'Chennai'
	user.createdTime = now
	user.updatedTime = now
	user.save()
}
else {
	user = entities[0]
}
println 'User - ' + user.id

entities = datastore.execute{
	from UserE
	where id == vrsumitha
	limit 1
}
if(entities.size() == 0 ) {
	user = new Entity('UserE')
	user.id = 'vrsumitha'
	user.password = 'wyd123'
	user.name = 'Sumitha'
	user.emailId = 'vrsumitha@wybis.com'
	user.timeZone = 'Chennai'
	user.createdTime = now
	user.updatedTime = now
	user.save()
}
else {
	user = entities[0]
}
println 'User - ' + user.id

entities = datastore.execute{
	from UserE
	where id == bvrenuga
	limit 1
}
if(entities.size() == 0 ) {
	user = new Entity('UserE')
	user.id = 'bvrenuga'
	user.password = 'wyd123'
	user.name = 'Renuga'
	user.emailId = 'bvrenuga@wybis.com'
	user.timeZone = 'Chennai'
	user.createdTime = now
	user.updatedTime = now
	user.save()
}
else {
	user = entities[0]
}
println 'User - ' + user.id

entities = datastore.execute{
	from UserE
	where id == guest
	limit 1
}
if(entities.size() == 0 ) {
	user = new Entity('UserE')
	user.id = 'guest'
	user.password = 'wyd123'
	user.name = 'Guest'
	user.emailId = 'guest@wybis.com'
	user.timeZone = 'Chennai'
	user.createdTime = now
	user.updatedTime = now
	user.save()
}
else {
	user = entities[0]
}
println 'User - ' + user.id

println """
</pre>
</body>
</html>
"""
println '------------------------------------------------------------------------------'